﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace BenevolentSunData
{
    public class MapSkin
    {

        public float AmbientLightPower;
        
        public Dictionary<String, Material> Materials = new Dictionary<String, Material>();


        public MapSkin()
        {
            
        }


        public Material GetMaterial(string key)
        {
            if (Materials.ContainsKey(key))
            {
                return Materials[key].Clone();
            }
            else
            {
                Material mat = new Material();
                Materials.Add(key, mat);
                return mat.Clone();
            }
        }
        

        public MapSkin Clone()
        {
            MapSkin mapSkin = new MapSkin();
            foreach (String key in Materials.Keys)
            {
                mapSkin.Materials.Add(key, Materials[key].Clone());
            }
            mapSkin.AmbientLightPower = AmbientLightPower;
            return mapSkin;
        }
    }

}
